/* 
* log打印颜色设置方法
*/
var logColor = function(e){
  var elist = [...arguments];
  var clist= [];
//     console.log(elist); 
  let colorList= ['red','blue','green','yellow'];
  let nameList= ['王麻子','李小龙','王大炮','美奈子'];
  if( elist.length>1 && typeof elist[0]==='string' && elist[0].startsWith('@') ){
      let _c=elist[0].split('@')[1];
      let _cidx = colorList.indexOf( _c );
      let name = _cidx>-1? nameList[_cidx] : '路人';
      clist.push( `%c${ name }：` );
      clist.push( `background-color:${ 
          elist[0].split('@')[1]
      }; color:${
           _c==='yellow'?'black':'white' 
      }; padding:2px;` );

      elist.splice(0,1);
  }
  clist.push(...elist);
  console.log(...clist)
}


//     logColor(1111, 5555);
//     logColor(2222);
//     logColor('@red', "李小龙你人呢？",'（不知道跑哪hi去也不叫我~）');
//     logColor('@blue', "干嘛，蹲坑呢");
//     logColor('@green', "天天带薪拉屎，我要举报你");
//     logColor('@yellow', "你们真恶心，天天说shi~~");
//     logColor('@#f68', '这个需求实现不了...');
//     logColor('@#000', '你行你来...');
//     logColor('@#996', {abc:123, ccc:444, dddd:{aaa:"dddd"}});
//     logColor('@#8daa2b', '下班啦~');

async function aa(){
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor(1111, 5555);
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@red', "李小龙你人呢？",'（不知道跑哪hi去也不叫我~）');
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@blue', "干嘛，蹲坑呢");
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@green', "天天带薪拉屎，我要举报你");
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@yellow', "你们真恶心，天天说shi~~");
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@#f68', '这个需求实现不了...');
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@#000', '你行你来...');
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@#996', {abc:123, ccc:444, dddd:{aaa:"dddd"}});
          logColor('@#996', 'aabbcc');
          logColor('@#996', ['ticket', 'room', 'goods', 'route']);
          resolve(1); 
      }, 1500);
  });
  await new Promise((resolve, reject)=>{
      setTimeout(()=>{
          logColor('@#8daa2b', '下班啦~');
          resolve(1); 
      }, 1500);
  });
}

aa();